package com.tc.dispatch.gsservice.util;

import com.tc.dispatch.gsservice.exception.*;
import com.tc.dispatch.gsservice.sql.inter.*;
import com.tc.dispatch.gsservice.sql.inter.PeiFangPriceDAO;

public class DAOFactory {
  public DAOFactory() {
  }

  public static OrderSumDAO getOrderSum() throws GSSysException {
    try {
      ServiceLocator sl = new ServiceLocator();
      String OrderSumDAOClassName = sl.getString(JNDINames.ORDER_SUM_DAO_CLASS);
      return (OrderSumDAO) Class.forName(OrderSumDAOClassName).newInstance();
    }
    catch (Exception ex) {
      throw new GSSysException();
    }
  }

  public static OrderSumMainDAO getOrderSumMain() throws GSSysException {
    try {
      ServiceLocator sl = new ServiceLocator();
      String OrderSumDAOClassName = sl.getString(JNDINames.
						 ORDERSUM_MAIN_DAO_CLASS);
      return (OrderSumMainDAO) Class.forName(OrderSumDAOClassName).newInstance();
    }
    catch (Exception ex) {
      throw new GSSysException();
    }
  }

  public static OrderSumSubDAO getOrderSumSub() throws GSSysException {
    try {
      ServiceLocator sl = new ServiceLocator();
      String OrderSumDAOClassName = sl.getString(JNDINames.
						 ORDERSUM_SUB_DAO_CLASS);
      return (OrderSumSubDAO) Class.forName(OrderSumDAOClassName).newInstance();
    }
    catch (Exception ex) {
      throw new GSSysException();
    }
  }

  public static OrderSumStepDAO getOrderSumStep() throws GSSysException {
    try {
      ServiceLocator sl = new ServiceLocator();
      String OrderSumDAOClassName = sl.getString(JNDINames.
						 ORDERSUM_STEP_DAO_CLASS);
      return (OrderSumStepDAO) Class.forName(OrderSumDAOClassName).newInstance();
    }
    catch (Exception ex) {
      throw new GSSysException();
    }
  }

  public static DianDuDAO getDianDu() throws GSSysException {
    try {
      ServiceLocator sl = new ServiceLocator();
      String OrderSumDAOClassName = sl.getString(JNDINames.DIANDU_DAO_CLASS);
      return (DianDuDAO) Class.forName(OrderSumDAOClassName).newInstance();
    }
    catch (Exception ex) {
      throw new GSSysException();
    }
  }



  public static WorkflowStepRelationDAO getWorkflowStepRelation() throws
      GSSysException {
    try {
      ServiceLocator sl = new ServiceLocator();
      String WorkflowStepRelationDAOClassName = sl.getString(JNDINames.
	  WORKFLW_STEP_RELATION_DAO_CLASS);
      return (WorkflowStepRelationDAO) Class.forName(
	  WorkflowStepRelationDAOClassName).newInstance();
    }
    catch (Exception ex) {
      throw new GSSysException();
    }
  }

  public static SpecTypeDAO getSpecType() throws GSSysException {
    try {
      ServiceLocator sl = new ServiceLocator();
      String SpecTypeDAOClassName = sl.getString(JNDINames.SPEC_TYPE_DAO_CLASS);
      return (SpecTypeDAO) Class.forName(SpecTypeDAOClassName).newInstance();
    }
    catch (Exception ex) {
      throw new GSSysException();
    }
  }

  public static OutProcessDAO getOutProcess() throws GSSysException {
    try {
      ServiceLocator sl = new ServiceLocator();
      String OutProcessDAOClassName = sl.getString(JNDINames.
	  OUT_PROCESS_DAO_CLASS);
      return (OutProcessDAO) Class.forName(OutProcessDAOClassName).newInstance();
    }
    catch (Exception ex) {
      throw new GSSysException();
    }
  }

  public static ProcessYieldDAO getProcessYield() throws GSSysException {
    try {
      ServiceLocator sl = new ServiceLocator();
      String ProcessYieldDAOClassName = sl.getString(JNDINames.
	  PROCESS_YIELD_DAO_CLASS);
      return (ProcessYieldDAO) Class.forName(ProcessYieldDAOClassName).
	  newInstance();
    }
    catch (Exception ex) {
      throw new GSSysException();
    }
  }

  public static ProcessFeeDAO getProcessFee() throws GSSysException {
    try {
      ServiceLocator sl = new ServiceLocator();
      String ProcessFeeDAOClassName = sl.getString(JNDINames.
	  PROCESS_FEE_DAO_CLASS);
      return (ProcessFeeDAO) Class.forName(ProcessFeeDAOClassName).newInstance();
    }
    catch (Exception ex) {
      throw new GSSysException();
    }
  }

  public static ProcessAreaDAO getProcessArea() throws GSSysException {
    try {
      ServiceLocator sl = new ServiceLocator();
      String ProcessAreaDAOClassName = sl.getString(JNDINames.
	  PROCESS_AREA_DAO_CLASS);
      return (ProcessAreaDAO) Class.forName(ProcessAreaDAOClassName).newInstance();
    }
    catch (Exception ex) {
      throw new GSSysException();
    }
  }

  public static ProcessNameDAO getProcessName() throws GSSysException {
    try {
      ServiceLocator sl = new ServiceLocator();
      String ProcessNameDAOClassName = sl.getString(JNDINames.
	  PROCESS_NAME_DAO_CLASS);
      return (ProcessNameDAO) Class.forName(ProcessNameDAOClassName).newInstance();
    }
    catch (Exception ex) {
      throw new GSSysException();
    }
  }

  public static ProcessFlowDAO getProcessFlow() throws GSSysException {
    try {
      ServiceLocator sl = new ServiceLocator();
      String ProcessFlowDAOClassName = sl.getString(JNDINames.
	  PROCESS_FLOW_DAO_CLASS);
      return (ProcessFlowDAO) Class.forName(ProcessFlowDAOClassName).newInstance();
    }
    catch (Exception ex) {
      throw new GSSysException();
    }
  }

  public static ProcessGateDAO getProcessGate() throws GSSysException {
    try {
      ServiceLocator sl = new ServiceLocator();
      String ProcessGateDAOClassName = sl.getString(JNDINames.
	  PROCESS_GATE_DAO_CLASS);
      return (ProcessGateDAO) Class.forName(ProcessGateDAOClassName).newInstance();
    }
    catch (Exception ex) {
      throw new GSSysException();
    }
  }
  public static OtherConstantsDAO getOtherConstants() throws GSSysException {
   try {
     ServiceLocator sl = new ServiceLocator();
     String OtherConstantsDAOClassName = sl.getString(JNDINames.OTHER_CONSTANTS_DAO_CLASS);
     return (OtherConstantsDAO) Class.forName(OtherConstantsDAOClassName).newInstance();
   }
   catch (Exception ex) {
     throw new GSSysException();
   }
 }
 public static SsignDensityDAO getSsignDensity() throws GSSysException {
   try {
     ServiceLocator sl = new ServiceLocator();
     String SsignDensityDAOClassName = sl.getString(JNDINames.SSIGN_DENSITY_DAO_CLASS);
     return (SsignDensityDAO) Class.forName(SsignDensityDAOClassName).newInstance();
   }
   catch (Exception ex) {
     throw new GSSysException();
   }
 }
 public static DefaultCheckDAO getDefaultCheck() throws GSSysException {
   try {
     ServiceLocator sl = new ServiceLocator();
     String DefaultCheckDAOClassName = sl.getString(JNDINames.DEFAULT_CHECK_DAO_CLASS);
     return (DefaultCheckDAO) Class.forName(DefaultCheckDAOClassName).newInstance();
   }
   catch (Exception ex) {
     throw new GSSysException();
   }
 }

 public static QianDaoYieldDAO getQianDaoYield() throws GSSysException {
  try {
    ServiceLocator sl = new ServiceLocator();
    String QianDaoYieldDAOClassName = sl.getString(JNDINames.QIANDAO_YIELD_DAO_CLASS);
    return (QianDaoYieldDAO) Class.forName(QianDaoYieldDAOClassName).newInstance();
  }
  catch (Exception ex) {
    throw new GSSysException();
  }
}

public static PeiFangPriceDAO getPeiFangPrice() throws GSSysException {
  try {
    ServiceLocator sl = new ServiceLocator();
    String PeiFangPriceDAOClassName = sl.getString(JNDINames.PEIFANG_PRICE_CLASS);
    return (PeiFangPriceDAO) Class.forName(PeiFangPriceDAOClassName).newInstance();
  }
  catch (Exception ex) {
    throw new GSSysException();
  }
}





}